<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript">
        window.onload=function()
        {
            //创建Symbol
            let s=Symbol();
            console.log(s,typeof s);
            let s2=Symbol("尚硅谷");
            let s3=Symbol("尚硅谷");
            let s4=Symbol("尚硅谷");
            let s5=Symbol("尚硅谷");
            console.log(s2);
            console.log(s3);
            console.log(s4);
            console.log(s5);
            //这个办法创建的Symbol值是不一样的，就算是输入相同的字符串
            console.log(s2==s3,s2===s4,s2==s5,s3===s4,s3==s5,s4===s5);

            //Symbol.for创建
            let s6=Symbol.for("尚硅谷");
            let s7=Symbol.for("尚硅谷")
            console.log(s6,typeof s6);
            console.log(s5,typeof s7);
            //此方法创建的Symbol值在输入相同的值的情况下是相等的
            console.log(s6===s7);

            //不能与其他数据进行运算
            //let result=s+100;
            //let result=s>100;
            //let result=s+"100";

            //USONB
            // u undefined
            //s string symbol
            //o object
            //n null number
            //b boolean
        };
    </script>
</head>
<body>
    
</body>
</html>